home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Archive Magazine CD 1995
/
Archive Magazine CD 1995.iso
/
text
/
hints
/
volume_04
/
issue_02
< prev
next >
Wrap
Text File
|
1995-02-16
|
15KB
|
353 lines
• 160k ADFS Discs (continued from Archive 4.1 p9) − It is certainly true
that the Archimedes can be made to read and write 160k or 320k ADFS
discs correctly. I think, however, that the Archimedes ‘sees’ these as
640k L format discs and if a read or write operation directs it to a
track beyond 39 (160k) it will try to push the disc head off the edge of
the disc searching for tracks that aren’t there. Fine if you know what
you’re doing. Lorcan Mongey.
4.02
• Am I in the desktop? You can use the Wimp_ReadSysInfo SWI command to
see if your program is running in the desktop or not. The command
returns the number of active tasks, which will be zero if the program is
running outside of the desktop environment. The example program below
will sense whether it has been run from the desktop environment and if
not, it will start up the desktop before running another application (in
this case !Edit).
4.02
program segment missing
4.02
Adrian Look.
4.02
• Apocalypse hints & tips − If you shoot the green T-shaped buildings
with a triangular roof using a mega photon your shield will be replen
ished. If you shoot a purple and green mushroom, your shield will go
into override but your points are decreased for anything you hit with
the photons you are allocated. If you shoot a rectangular brown
building they leave a shallow pyramid and if you shoot this, a Rakon
Gomjabba will appear and you will get a few more points for destroying
this. If you shoot a Snail Rider with a mega photon, your energy banks
are recharged. If you shoot a green mushroom, your score will decrease
for everything you hit with the mega photons allocated.
4.02
If you type in and run the following program with disc two in drive 0
you will then be able to access all of Apocalypse’s nine worlds.
4.02
program segment missing
4.02
Paul Bedford.
4.02
• Bug in the Debugger Module − Some of you may be aware of a problem
with the Debugger module failing to disassemble certain instructions
correctly if they contain an immediate constant. An immediate constant
is stored as an eight-bit value with a 4-bit shift applied, and the
debugger normally expands this format to its correct value, but
occasionally fails, e.g.
4.02
E28F0C01 ADD R0,PC, #&0100 correctly expanded
4.02
E28F0D01 ADD R0,PC, #&01,26 failed to expand (should be #&40)
4.02
I have disassembled the debugger module and found the offending piece of
code. It doesn’t seem to be a bug, rather a deliberate move to expand
constants differently under certain circumstances but for no obvious
reason. Anyway, the fix is to change the word at offset &920 in the
module from &1A000028 to &FA000028, effectively changing a BNE to a BNV.
This seems to solve the problem, although I haven’t tested this fix
exhaustively, so proceed with caution. Lorcan Mongey.
4.02
• BUILDing !Run files − If you write a !Run file using *BUILD and want
to include a line such as:
4.02
Run <Obey$Dir> .!RunImage
4.02
then, instead, you should type:
4.02
Run |<Obey$Dir>.!RunImage
4.02
to prevent RISC-OS from inserting the value of Obey$Dir into the file.
It may be obvious but until now I have been using !Edit to write a two
line Obey file! Elliott Hughes.
4.02
• Copy Options − “Confirm” and “Verbose” − I think this is probably one
of those hints which would be classed as “obvious” by those who know it:
The Archimedes User Guide and the PRM both describe, at some length, the
use of the system variable Copy$Options which sets default options for
the *Copy command. However, neither make if clear that the desktop
filer has its own “Confirm” and “Verbose” options which are quite
independent of those which are stored in the system variable. Thus no
amount of modification of Copy$Options in boot files or elsewhere will
affect the way the desktop behaves.
4.02
The filer options can be read and changed by clicking the menu button
over any directory window and choosing the Options option. The options
selected by this route differ in one significant way from the
Copy$Options in that they are stored in battery-backed RAM and thus are
preserved when the machine is switched off or reset. They are stored in
byte 198 of the CMOS RAM (not byte 195 as my copy of the PRM says) along
with various other desktop options:
4.02
program segment missing
4.02
Having these options stored in CMOS RAM can sometimes be an advantage
but on the whole I find it rather inconvenient. For instance, I often
change temporarily from an icon display to “Full Info” and would like
icons to be restored after a reset. Luckily this sort of preference can
easily be dealt with by a few lines in the boot routine. For instance,
the following lines of BASIC will reset the Display mode to small icons
while preserving the other options:
4.02
program segment missing
4.02
Hugh Eagle.
4.02
• Cut and paste clip board − Many RISC-OS applications have a ‘cut and
paste’ option. If these applications can also edit more than one
document at a time then you can use the ‘cut and paste’ option as a clip
board to transfer data from one document to another. For example, you
can select a block of text in one !Edit document, move to another
document and then use the <ctrl><c> option to copy the block into that
document. This method will also work with applications such as
PipeDream but not Ovation or Impression, etc as they use the ‘clip
board’ method. Steve Drain.
4.02
• Deskjet Plus Ink Cartridges, Recharging − You may have discovered the
same problem as me when trying to recharge these cartridges, namely that
the ink won’t go in the hole!
4.02
A bit of reverse engineering, with the aid of a hacksaw, has revealed
the cause. The container is filled with a dense spongy material which
holds the ink, but this does not enter the cavity formed by the raised
green portion with the central vent hole. If a syringe needle is
entered through this hole it must be long enough to reach into the
sponge. At least 20mm is required. If this is not the case then the
inserted ink charge is held on top of the sponge by surface tension, and
quickly overflows through the charge hole.
4.02
The only syringes which I can get hold of are intended for diabetics and
have a needle which is too short to reach the sponge through the top
hole. The solution is to fill the sponge through the top hole. The
solution is to fill through a second hole, drilled as small as possible,
on the 3mm wide land to the side of the raised portion. In this
location there is a small internal cavity not filled with sponge. This
prevents capillary leakage after recharging.
4.02
Archive readers may be interested in the following program which will
draw a sketch showing the location of the hole. It should be made as
close to the vertical wall of the raised portion as is possible.
4.02
program segment missing
4.02
With regard to inks I have excellent results with Rotring Art Pen Ink
which comes in many colours. Bill Graham.
4.02
• MEMC DMA control register − With reference to Sean Kelly’s tip in June
‘90 for gaining extra speed from the Archimedes by disabling the VIDC’s
DMA access. Although the technique normally works without any trouble,
occasionally the machine crashes or has its memory contents corrupted.
As Sean correctly stated, bit 10 of the MEMC register controls VIDC DMA,
however, as the dynamic RAM (DRAM) in the machine is no longer being
read by the VIDC it is also no longer being refreshed properly. Bits 8
& 9 of the MEMC come to the rescue, they are the DRAM refresh control
bits.
4.02
There are three available modes of refresh:-
4.02
bit 8 bit 9
4.02
a) no refresh 1 0
4.02
(not used by the Archimedes)
4.02
b) refresh during video flyback 0 1
4.02
c) continuous refresh 1 1
4.02
Flyback time during standard modes (0-16 & 24) is greater than the DRAM
holding time and as such requires refresh during flyback. In multi-sync
modes the flyback time is much faster and the memory does not need to be
refreshed by the MEMC.
4.02
The codes for the various modes are:-SYS“OS_UpdateMEMC‘,768,1792 to turn
off the VIDC DMA and invoke continuous refresh and
SYS“OS_UpdateMEMC‘,1536,1792 to return to normal for standard modes.
4.02
It should be pointed out that the continuous refresh mode uses the DMA
video pointer as the refresh address source, incrementing the pointer
after use. As such this should be used with care if the pointer is used
as an active part of your program whilst the screen is blanked. (But
why would you want to move the pointer if you can’t see it??)
4.02
There is also a sound DMA control bit in the MEMC but as this does not
affect memory refresh bits 8 and 9 which do not need to be altered.
4.02
Bit 11 − 0 Sound DMA disable
4.02
1 Sound DMA enable
4.02
Rob Swain.
4.02
• Modifying the RISC-OS dot matrix printer driver − To add a new dot
matrix printer configuration to the RISC-OS printer driver you will need
to alter the ‘PrData’ file in the ‘!PrinterDM’ directory (on you
Applications Disc One or RISC-OS Extras Disc = Shareware 17):
4.02
1) Make sure you have made a back up copy
4.02
2) Run the !Edit program on Applications Disc One
4.02
3) Double click on the copy of !PrinterDM that you wish to alter,
whilst holding the <shift> key down − a filer window will then open with
the contents of the !PrinterDM application inside
4.02
4) Double click on the ‘PrData’ file in the !PrinterDM filer window − a
text window will then open
4.02
5) Use the arrow keys to position the caret (red vertical text cursor)
just before the ‘Configured options’ heading and after the row of full
stops
4.02
6) Add the following text changing the information to match your
printer (the example below adds a Shinwa CP80/Lucas LX80 option to the
RISC-OS printer driver):
4.02
program segment missing
4.02
Alan Dawes
4.02
• Nevryon hints & tips − Nevryon passwords for level three, five and
seven are given at the foot of this column, the letters being reversed
for the benefit of those who prefer to ignore them.
4.02
The following Nevryon cheat allows the ship to be upgraded to have any
weapons desired and energy/credits/lives may also be altered.
4.02
Load the ‘!Nevryon.Multi’ file on the Nevryon disc 1 and insert the
following at line 211.
4.02
211 Dump=PAGE-&3F800:Dump?n=value
4.02
where n is:
4.02
n=27: Ship speed, 4 recommended
4.02
n=28: Shield orb (top), 1=ON 0=Off
4.02
n=29: Shield orb (bottom), 1=ON 0=OFF
4.02
n=30: RAM, 1=ON, 0=OFF
4.02
n=32: Gun droids, 0-2
4.02
n=33 Lasers, 0-2
4.02
n=35: Number of credits (default 3)
4.02
n=36: Number of lives (default 4)
4.02
n=37: Starting secondary weapons status, 0=Off, 1=flamer, etc
4.02
n=38: Gold bar status, 0=OFF, 1=flamer, 2=mines, etc
4.02
n=43: Amount of energy (default 12)
4.02
Change as many of these values as you want and save altered program and
repeat the process for the $.Multi file on the Nevryon 2 disc. Jeremy
Mears.
4.02
upside down words missing!
4.02
• Printing a full path name − This is a reply to the cry of help in
February 1990 from Richard Skemp about how to get the printer driver to
include the full pathname. If you add the following line to the Library
program in the !PrinterDM directory, the printer driver will print the
full file pathname of any text file you print.
4.02
3281 BPUT#outfile%, CHR$13+CHR$10 +“Printing file ”+filenam$
+CHR$13+CHR10+CHR$10
4.02
Lorcan Mongey.
4.02
• Reinstating the filer module − An item on system variables mentions
that if you *RMFaster the filer module from the desktop, you lose the
filer icons and can’t get them back (Archive 3.11 p7). To retrieve
them, try:
4.02
<F12>
4.02
Desktop
4.02
<Return>
4.02
this doesn’t interfere with anything already in the desktop but re-
starts any of the default tasks that have been lost, namely Filer,
PaletteUtil an TaskManager. Note, however, that if you *RMKill or
*RMFaster the Task Manager, you can’t get a *prompt by pressing F12! To
get around this, make up an Obey file containing the command
4.02
*Desktop
4.02
and this will do the trick. It’s quite interesting to see the Task and
Palette icons in the “wrong” place on the icon bar! However, I feel
that you should not deliberately interfere with desktop modules and this
method should really be regarded as a ‘get-you-home’ technique in case
of problems. Lorcan Mongey.
4.02
•REMming your programs − When writing a program, in any language, it is
good practice to put plenty of comments in to remind oneself what each
particular section of code does. However, in BASIC, there are two
things which tend to deter one from following this practice. The first
is that the interpreter has to recognise a REM statement before it knows
to ignore it. This takes time, which may be undesirable in procedures
and loops. The second deterrent is the amount of space taken by the
text of the comment, which is stored verbatim in the program.
4.02
I have a practice, when commenting procedures and functions, of placing
explanatory comments outside the procedure/function block. For
instance:
4.02
program segment missing
4.02
Clearly, the above practice prevents the REM statements from impacting
the performance of the procedure/function, as they are in section of the
code which the interpreter will never see.
4.02
This last observation leads to an additional possibility for interpreted
code (but not for compiled BASIC). Since the interpreter never sees
these lines between procedure/function blocks, the normal syntax rules
can be broken without an error being generated. Thus, we can save some
space, as well as execution time, by omitting the REM key words. Note
that this will only work if the comments are where the interpreter
cannot see them. If you are in the habit of using GOTO statements
(sometimes a handy way of removing umpteen layers of IF... THEN... ELSE
statements if you are checking for exceptions and, despite common
‘wisdom’, still used frequently by professional programmers), this
placing of syntactically incorrect code beyond the bounds of a procedure
block might allow the trapping of such errors as omitting the ENDPROC or
= statements. David Hazel.
4.02
• Star LC10 − An undocumented feature on a Star LC10 Colour Printer, is
that if you open out a file to the printer and try and print characters
27 and 102 to it, it prints out the current dip switch setting:
4.02
program segment missing
4.02
Jason Ede.
4.02
• System Variables (continued from 4.1 p9 & 4.1 p10) − I had had similar
problems and came up with a different solution which can solve both
problems, i.e. reading system variables to BASIC and passing system
variables to the Filer module. I use a call to OS_EvaluateExpression,
which can return a numeric or string value, as follows:
4.02
program segment missing
4.02
This is an artificial example; in practice you would know whether you
were expecting a numeric value or a string, such as Obey$Dir. Lorcan
Mongey.
4.02
4.02
4.02